﻿using System;


namespace FormClient
{
    class Callback:MServiceReference.IMessageServiceCallback
    {
        public delegate void MessageReceiveHandeler(object sender,MessageReceiveArgs e);
        public event MessageReceiveHandeler MessageReceived;
  
        public void ReceiveMessage(string name, string msg)
        {
            MessageReceiveArgs arg = new MessageReceiveArgs(name, msg);
            MessageReceived(this, arg);
        }

        public class MessageReceiveArgs 
        {
            public MessageReceiveArgs(string name, string msg) 
            {
                this.Name = name;
                this.Message = msg;
            }
            public string Name { get; set; }
            public string Message { get; set; }
        }
    }
}
